package cn.tk.service.mr.impl;

import cn.tk.model.entity.mr.Entity;
import cn.tk.model.entity.mr.EntityValue;
import cn.tk.repository.mr.EntityDao;
import cn.tk.repository.mr.EntityValueDao;
import cn.tk.service.mr.EntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by denglw on 2021/8/3.<br/>
 * Desc: 实体 服务实现层
 */
@Service
public class EntityServiceImpl implements EntityService {

    @Autowired
    private EntityDao entityDao;

    @Autowired
    private EntityValueDao entityValueDao;

    @Override
    public List<Entity> getAll() {
        return entityDao.findAll();
    }

    @Override
    public List<EntityValue> getValues(Long entityId) {
        return entityValueDao.findEntityValues(entityId);
    }

    @Override
    public EntityValue getValue(Long valueId) {
        return entityValueDao.getOne(valueId);
    }
}
